package com.yl.config;

import com.google.protobuf.Api;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;

/**
 * @author yangl
 */
@Configuration
@EnableSwagger2
public class SwaggerConfiguration {
    Contact DEFAULT_CONTACT = new Contact("yl", "http://tec.hlclub.top/", "474993468@qq.com");
    @Bean
    public Docket docket(){
        ApiInfo apiInfo = new ApiInfo(
                "dubbo 学习文档",
                "Api Document",
                "v-1.0",
                "http://tec.hlclub.top/",
                DEFAULT_CONTACT,
                "Apache 2.0",
                "http://www.apache.org/licenses/LICENSE-2.0",
                new ArrayList()
        );
        return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo);
    }
}
